class Solution {
public:
    bool isPalindrome(int x) {
        if(x<0)return false;
        long int y=0,n=x;
        while(x>=10){
            y=y*10+x%10;
            x/=10;
        }
        y=y*10+x;
        if(n==y)return true;
        else return false;
    }
};
